USE msdb;
GO

BACKUP database msdb To DISK='D:\backup\msdb.bak'
BACKUP LOG msdb To DISK='D:\backup\msdb_Log.bak'

-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE msdb
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (MSDBLog, 10); 
GO

-- Reset the database recovery model.
ALTER DATABASE msdb
SET RECOVERY FULL;
GO


sP_helpfile
